import requests
TK = "https://aip.baidubce.com/oauth/2.0/token"
AK = "EZtrxYr4kw57X1VkSXSwMIlx"
SK = "DwHlFxGGA1HHwYZfyihc6Oc4f7VG5gJ7"
ak='3WpzaBLKLn7JT1aJOgIT05Md'
sk='DWfaxS2ME19DdFjcfM4jsnx1W5mqKr2R'

Body = "https://aip.baidubce.com/rest/2.0/image-classify/v1/body_num"
SFZ = "https://aip.baidubce.com/rest/2.0/ocr/v1/idcard"

TTS = "https://tsn.baidu.com/text2audio"
Long_TTS = "https://aip.baidubce.com/rpc/2.0/tts/v1/longtts"
OCR= 'https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic'
def get_acc_api(AK,SK):
    params = {
        "grant_type": "client_credentials",
        "client_id": AK,
        "client_secret": SK
    }
    response = requests.post(TK, params=params)
    return response.json()['access_token']
API= get_acc_api(AK,SK)
TTS_TK = get_acc_api(ak,sk)